import request from '@/utils/request'
import API from './BaseApi'

// 查询活动推广详情信息列表
export function listActivities(params) {
  return request({
    url: API.ADMIN_URL + '/xcx/activity/list',
    method: 'get',
    params: params
  })
}

// 添加活动信息
export function addActivity(data){
  return request({
    url: API.ADMIN_URL + '/xcx/activity/add',
    method: 'post',
    data: data
  })
}

// 删除活动信息
export function deleteActivity(params){
  return request({
    url: API.ADMIN_URL + '/xcx/activity/delete',
    method: 'get',
    params: params
  })
}

// 查询用户列表
export function getUserInfoList(params) {
  return request({
    url: API.ADMIN_URL + '/xcx/user/list',
    method: 'get',
    params: params
  })
}

// 查询枚举
export function getDic(params) {
  return request({
    url: API.ADMIN_URL + '/xcx/dic/get',
    method: 'get',
    params: params
  })
}

// 订单列表
export function getActivityOrderList(params) {
  return request({
    url: API.ADMIN_URL + '/xcx/order/list',
    method: 'get',
    params: params
  })
}

// 从聚推客同步订单
export function syncActivityOrder(params){
  return request({
    url: API.ADMIN_URL + '/xcx/order/sync',
    method: 'get',
    params: params
  })
}

// 查询用户提现信息
export function getUserWithdrawList(params) {
  return request({
    url: API.ADMIN_URL + '/xcx/withdraw/list',
    method: 'get',
    params: params
  })
}

// 转账
export function giro(params) {
  return request({
    url: API.ADMIN_URL + '/xcx/withdraw/giro',
    method: 'get',
    params: params
  })
}

// 文本添加
export function addText(data) {
  return request({
    url: API.ADMIN_URL + '/xcx/text/add',
    method: 'post',
    data: data
  })
}

// 文本查询
export function listText(params) {
  return request({
    url: API.ADMIN_URL + '/xcx/text/list',
    method: 'get',
    params: params
  })
}

// 文本删除
export function deleteText(params) {
  return request({
    url: API.ADMIN_URL + '/xcx/text/delete',
    method: 'get',
    params: params
  })
}

// 查询图片
export function listImages(params) {
  return request({
    url: API.ADMIN_URL + '/xcx/image/list',
    method: 'get',
    params: params
  })
}

// 删除图片
export function deleteImage(params) {
  return request({
    url: API.ADMIN_URL + '/xcx/image/delete',
    method: 'get',
    params: params
  })
}

export function addImage(data){
  return request({
    url: API.ADMIN_URL + '/xcx/image/add',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}
